<template>
  <div>
    <div class="main" @click="handlerMain(item, id)">
      <img :src="item.listPicUrl" />
      <div class="some">{{ item.name }}</div>
      <div class="price">￥{{ item.counterPrice }}</div>
    </div>
  </div>
</template>

<script>
import { reqCategorysList } from "../../api";
export default {
  name: "list",
  props: ["item", "id"],
  data() {
    return {
      list: [],
    };
  },
  methods: {
    async getData() {
      // let result = await reqCategorysList();
      // this.list = result.data.categoryItems.itemList;
    },
    handlerMain(item, id) {
      this.$router.push({
        path: "/detail2",
        query: {
          item,
        },
      });
    },
  },
  mounted() {
    this.getData();
  },
};
</script>

<style lang="less" scoped>
.main {
  img {
    width: 4.1rem;
    height: 4.1rem;
    // background-color: green;
    // border: 1px solid black;
    display: block;
    border-radius: 0.5rem;
  }
  .some {
    font-size: 0.3rem;
  }
  .price {
    color: red;
    font-size: 0.4rem;
  }
}
</style>
